package nc.bs.gl.impl;

import nc.bs.common.util.pojo.SettleRecord;
import nc.bs.gl.ISettleAccountValidateService;
import nc.bs.gl.validate.SettleValidateProcessor;
import nc.bs.logging.Logger;
import nc.pubitf.para.SysInitQuery;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nccloud.web.uapbd.pmbase.eps.action.EpsCommonConst;

/**
 * @author duanyp1
 * @date 2024/3/15 10:39
 */
public class SettleAccountValidateServiceImpl implements ISettleAccountValidateService {

    private static final String initCode;

    static {
        initCode = "SValidate";
    }

    @Override
    public void validateAccount(SettleRecord record) {
        try {
            UFBoolean flag = SysInitQuery.getParaBoolean(EpsCommonConst.PK_GLOBE, initCode);
            if (UFBoolean.FALSE.equals(flag)) return;
            SettleValidateProcessor settleValidateProcessor = new SettleValidateProcessor();
            settleValidateProcessor.init(record);
            settleValidateProcessor.validate();
        } catch (Exception e) {
            Logger.error(e);
            ExceptionUtils.wrappException(e);
        }

    }
}
